home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 013a / font_m21.zip / PAS_DEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1991-08-01  |  3KB  |  83 lines

  1. (* FONT MANIA pascal font *)
  2.  
  3. uses
  4.     DOS, CRT;
  5.  
  6. (*--------------------------------------------------------------------------
  7.  
  8.    Font is saved in the filenamed DEMO.PAS.  To use the font, you must call
  9.    interrupt 10h, function 11h, sub-function 10h to load up the font.
  10.    
  11.    The following are the parameter needed to call the function:
  12.   
  13.                   AX  =  $1110      (ah = $11, al = $10)
  14.           BH  =  bytes per character 
  15.           BL  =  block to load to.  (use 0)
  16.           CX  =  number of character defined by table
  17.           DX  =  starting character value
  18.           ES  =  segment of the table (use Seg())
  19.           BP  =  offset of the table (use Ofs())
  20.  
  21.    Notice:  You should always upload the character immediately after set
  22.             the Video mode.  Also you must make sure that page 0 is active.
  23.         If it is not call immediately after the video mode set, some
  24.         side effects may occur.  I had experience some palette errors
  25.         my self, when I call this function with out changing video 
  26.         mode.  This doesn't happen all the time, however.  But be on 
  27.         the safe side is the best.   
  28.    
  29.    FONT MANIA will supply you with the height of the font.  It is defined
  30.    by your label name with "_POINTS" added at the end of the string.  For
  31.    example, if your label reference is call DEMO, then DEMO_POINTS will 
  32.    represent the byte-per-character of the font (the height of the font).
  33.    
  34.    Set the CX to 256 if you want to upload the whole font.   If you want to 
  35.    only upload part of font.  Set CX to whatever number of the character 
  36.    you want to upload, and set DX to the first character you want to upload.
  37.    
  38.    For example, suppose you want to upload the character 65 to 88, 
  39.    ('A' to 'Z') and the label reference is DEMO.  Here are the parameter
  40.    needed:
  41.    
  42.          AX  =  $1110;
  43.          BH  =  DEMO_POINTS;
  44.          BL  =  0;
  45.          CX  =  24;               ( 24 characters to load )
  46.          DX  =  65;               ( first character to load )
  47.          ES  =  Seg(DEMO);
  48.          BP  =  Ofs(DEMO);
  49.          
  50.    See below for examples of how to set the registers. 
  51.          
  52.           
  53. ---------------------------------------------------------------------------*)
  54.  
  55. {$I DEMO.PAS}            
  56. Var
  57.    r : registers;
  58.    temp : char;
  59.  
  60. BEGIN
  61.   WriteLn('This is a font test');
  62.   WriteLn('Press any key to begin upload the font');
  63.   temp := readkey;
  64.  
  65.   r.ax := $0500;            (* make sure that it's page 0 *)
  66.   intr($10, r);
  67.   
  68.   r.ax := 3;                (* must set the vdo mode first *)
  69.   intr($10, r);
  70.  
  71.   r.ax := $1110;
  72.   r.bh := test_points;                   (* bytes per character *)
  73.   r.bl := 0;                             (* load to block 0 *)
  74.   r.cx := 256;                           (* 256 characters *)
  75.   r.dx := 0;                             (* start with character 0 *)
  76.   r.es := Seg(test);                     (* segment of table *)
  77.   r.bp := Ofs(test);                     (* offset of the table *)
  78.   intr($10, r);
  79.  
  80.   WriteLn('Font loadded');
  81.   temp := readkey;
  82.  
  83. END.